package user;

import book.BookList;
import operation.IOperation;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28463
 * Date: 2022—05—21
 * Time: 11:19
 */
public abstract class User {
    //写protected是后面要继承
    protected String name;//用户名
    protected IOperation[] iOperations;//此时并没有初始化化和分配大小
    //提供一个构造方法，用来初始化当前对象name属性
    public User(String name) {
        this.name = name;
    }

    public abstract int menu();

    public void doOperation(int choice, BookList bookList) {
        this.iOperations[choice].work(bookList);
    }
}

